package com.yy.satokenapplication.manager;

import jakarta.annotation.Resource;
import org.springframework.cache.CacheManager;
import org.springframework.cache.interceptor.CacheErrorHandler;
import org.springframework.cache.interceptor.CacheResolver;
import org.springframework.cache.interceptor.SimpleCacheErrorHandler;
import org.springframework.cache.interceptor.SimpleCacheResolver;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;

/**
 * @author young
 * Date 2025/3/17 下午7:17
 * Description: cursor_project
 */
@Component
public class CacheConfigManger {

    @Resource
    private CacheManager cacheManager;
    @Bean
    public CacheResolver cacheResolver() {
        return new SimpleCacheResolver(cacheManager);
    }

    @Bean
    public CacheErrorHandler errorHandler() {
        return new SimpleCacheErrorHandler();
    }
}
